package com.gl.controller.admin;

import com.gl.pojo.Result;
import com.gl.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/admin")
public class AdminController {
    @Autowired
    private UserService userService;

    /**
     * 管理员删除用户
     */
    @PostMapping("/users/delete")
    public Result deleteUser(@RequestParam("id") String userId) {
        userService.deleteById(userId);
        return Result.success();
    }
}
